#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
/*
10 2
???(*??(?)
7 3
(*??*??
100 18
?*?????)?????*????????*??(*???????*????????????*???*?????*?????*??????*****??*??????????*???????????
500 57
????*???***??*?????(????????*?**??????(??????????*??**??*?????????????????????*??????????*?????**????*?????????????????????*?????????????????????????????????*)*?????*????*??*???????????*????????????????*?????*?????*?*???)?????????*????*???*??????????????*???????????????????????*?????*?????*????????????????**??*?????????*?????????????????*??**?????????????*????**?*??*??*??????????*???*??**?(?*???????????????????????????**???????????***??????????*???????*)*???*?????????????????????*????????*????*?
*/
struct node{
	char s;
	int l;
}cc1[10001];
int MOD=1e9+7;
int dp[555][555],ans=0;
int m,k;
string s;
string cc[100001];
int cck=0;
bool c1(int l,int r)
{
	memset(cc1,0,sizeof(cc1));
	int top=0;
	for(int i=l;i<=r;i++)
	{
		if(s[i]==')')
		{
			while(cc1[top].s!='('&&top>0)
			{
				top--;
			}
			if(top==0)
			{	
				return false;
			}
			if(s[cc1[top].l+1]==s[i-1]&&s[cc1[top].l+1]=='*')
			{
				bool xx=true;
				for(int j=cc1[top].l+1;j<=i-1;j++)
				{
					if(s[j]!='*')
					{
						xx=false;
						break;
					}
				}
				if(xx==false)
				{
					return false;
				}
			}
			top--;
		}
		else
		{
			cc1[++top].s=s[i];
			cc1[top].l=i;
		}
	}
	for(int i=1;i<=top;i++) if(cc1[top].s=='(') 
	{
		return false;
	}
//	if(top!=0) return false;
	return true;
}
bool check(int l,int r)
{
	char cc[1001],top=0;
	bool f=true;
	for(int i=l;i<=r;i++)
	{
		if(s[i]==')')
		{
			f=false;
			if(cc[top-1]=='(')
			{
				top--;
			}
			else return false;
		}
		else if(s[i]=='(')cc[top++]=s[i];
	}
	if(f) return false;
	if(top!=0) return false;
	return true;
}
void dfs(int l,int r)
{
//	if(dp[l][r]) return dp[l][r];
	
	if(l>r) return;
	bool flag=true;
	for(int i=0;i<s.length();i++)
	{
		if(s[i]=='?')
		{
			flag=false;
			break;
		}
	}
	if(flag)
	{
		if(c1(0,s.length()-1)&&s[0]=='('&&s[s.length()-1]==')'&&check(0,s.length()-1))
		{
			for(int i=0;i<cck;i++)
			{
				if(s==cc[i]) return;
			}
			cc[cck++]=s;
			return;
		}
		else return;
	}int ans=0;
	for(int i=l;i<=r;i++)
	{
		if(s[i]=='?')
		{
			s[i]='(';
			dfs(l,i);dfs(i+1,r);
			s[i]=')';
			dfs(l,i);dfs(i+1,r);
			s[i]='*';
			int z=i,zz=0;
			while(s[z--]=='*') zz++;
			z=i;
			while(s[++z]=='*') zz++;
			if(zz<=k)
			{
				dfs(l,i);dfs(i+1,r);
			}
			s[i]='?';
		}
	}
//	dp[l][r]=ans;
	return;
}
int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	cin>>m>>k;
	cin>>s;dfs(0,s.length()-1);
//	for(int i=0;i<s.length();i++) dp[i][i]=0;
	cout<<cck%MOD;
//	if(c1(0,s.length()-1)) cout<<"YES";
	fclose(stdin);
	fclose(stdout);
}
